/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.ove.errordialog;

/**
 *
 * @author Mr.Sam
 */
import java.awt.*;
import java.awt.event.*;

/**
* A dialog box for error messages.<BR>
* The error messages must take the form of a <CODE>java.awt.Component</CODE>
* (and subclasses), that way sophisticated managment errors can be achieved.
*
* @author © 1998 DIRAT Laurent
* @version 1.0  13/04/99
*/
public class ErrorDialog extends Dialog {
	public ErrorDialog(Frame parent, boolean modal)	{
		super(parent, modal);
		
		setLayout(new BorderLayout(0, 0));
		setTitle("Oups, we've got a problem...");
		
		addWindowListener(
		    new WindowAdapter()	{
        		public void windowClosing(WindowEvent event) {
        			dispose();
            	}
            }
        );
    }
    
    public void addMesg(Component mesg) {
        add("Center", mesg);
        validate();
    }

}
